package com.sduept.nwld.dataserver.manager.faultforecast;

import com.sduept.bigdata.weather.entity.SimpleIcingModel;
import com.sduept.nwld.dataserver.model.faultforecast.IceFaultSample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("IceFaultForecastImpl")
public class IceFaultForecastImpl implements FaultForecastService{

	@Autowired
	private IceFaultForcastManager manager;
	
	/**
	 * 设置样本值。这里采用存库的方法。
	 */
	@Override
	public void setSamples(List<IceFaultSample> samples) {
		manager.setSamples(samples);
	}

	/**
	 * 训练样本。
	 */
	@Override
	public void startTrain() {
		manager.train();
	}

	/**
	 * 对SimpleIcingModel数据进行预测，返回IceFaultForecast模型。
	 */
	@Override
	public Map<String, Double> doForecast(SimpleIcingModel iceData) {
		return manager.doForecast(iceData);
	}

}
